const express = require('express')
const app = express()

app.set('views', './templates')
app.set('view engine', 'ejs')

app.get('/', (req, res) => {
    const users = [
        {id: 1, name: '张三'},
        {id: 2, name: '李四'}
    ]
    res.render('site/index2', {
        users: users,
        show: !!req.query.show
    })
})

app.listen(8899, () => {
    console.log('listen on 8899');
})